function price = underlyingpath(S0, mu, sigma, T, N)
deltaT = T / N;
price = zeros(N + 1, 1);
price(1) = S0;

for i = 2 : N + 1
    price(i) = price(i - 1) * exp((mu - sigma^2 / 2) * deltaT + sigma * sqrt(deltaT) * randn(1));
end
end